<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181022_070910_ADD_FIELD_PRODUCT_LOG
 */
class m181022_070910_ADD_FIELD_PRODUCT_LOG extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('{{product_log}}', 'name', Schema::TYPE_STRING. "(255) NULL COMMENT '文件名称' AFTER file_path ");
        $this->addColumn('{{product_log}}', 'ext', Schema::TYPE_STRING. "(16) NULL COMMENT '文件扩展名' AFTER name ");
        $this->addColumn('{{product_log}}', 'size', Schema::TYPE_STRING. "(16) NULL COMMENT '文件大小' AFTER ext ");

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181022_070910_ADD_FIELD_PRODUCT_LOG cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181022_070910_ADD_FIELD_PRODUCT_LOG cannot be reverted.\n";

        return false;
    }
    */
}
